package jgame.model;

public class Unit {
	Position position = new Position();
	Sight sight = new Sight();
	
	public Unit() {
		// FIXME: units need to be registered
		// jgame.TickManager.add(this);
	}
	
	public Position getPosition() {
		return position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}
	
	public void moveTick() {

	}
	
	public void discoverTick(Unit discovered) {
		
	}

	public String toString() {
		return "Position: " + this.position;
	}
	
	public int distanceTo(Unit unit) {
		int x = Math.abs(this.getPosition().getX() - unit.getPosition().getX());
		int y = Math.abs(this.getPosition().getY() - unit.getPosition().getY());
		int c = (int)Math.sqrt((x*x + y*y));

		return c;
	}

	public Sight getSight() {
		return sight;
	}

	public void setSight(Sight sight) {
		this.sight = sight;
	}
}
